<?php


namespace app\admin\controllers;


use app\admin\services\WithdrawService;
use app\BaseController;
use app\Request;

class WithdrawController extends BaseController
{
    private $withdrawService;

    public function __construct(WithdrawService $withdrawService)
    {
        $this->withdrawService = $withdrawService;
    }

    public function index(Request $request)
    {
        $result = $this->withdrawService->search($request);
        return $this->success($result);
    }

    public function show($id)
    {
        $result = $this->withdrawService->show($id);
        return $this->success($result);
    }

    public function delete($id)
    {
        $result = $this->withdrawService->delete($id);
        return $this->success($result);
    }

    // 提现审核
    public function audit(Request $request, $id)
    {
        $result = $this->withdrawService->audit($request, $id);
        return $this->success($result);
    }

    public function userStatistics($id)
    {
        $result = $this->withdrawService->statistics($id);
        return $this->success($result);
    }
}
